<template>
	<view class="search">
		<!-- <input type="text" v-model="input" @change=''/> -->
		<view class="shousuo">
			<input type="text" v-model="input" />
			<image src="../../static/iamges/caigu/caigu-1@2x.png" mode="" @click="sousuo"></image>
		</view>
		<view class="box" v-for="(item,index) in funds" :key='index'>
			<view class="box1">
				<view style="color: #ff4658; font-size: 50rpx;">{{item.content.fundValue}}%</view>
				<view style="color: #333333; font-size: 18rpx;">{{item.content.fundName}}</view>
			</view>
			<view class="box2">
				<view style="color: #333333; font-size: 30rpx;">七日年化</view>
				<view style="color: #333333; font-size: 30rpx;">产品名称</view>
			</view>
		</view>
		<view class="box" v-for="(item,index) in golds" :key='index'>
			<view class="box1">
				<view style="color: #ff4658; font-size: 50rpx;">{{item.content.fundGoldPrice}}</view>
				<view style="color: #333333; font-size: 18rpx;">{{item.content.fundName}}</view>
			</view>
			<view class="box2">
				<view style="color: #333333; font-size: 30rpx;">历史价格</view>
				<view style="color: #333333; font-size: 30rpx;">产品名称</view>
			</view>
		</view>
		<view class="box" v-for="(item,index) in regular" :key='index'>
			<view class="box1">
				<view style="color: #ff4658; font-size: 50rpx;">{{item.content.fundGoldPrice}}</view>
				<view style="color: #333333; font-size: 18rpx;">{{item.content.fundName}}</view>
			</view>
			<view class="box2">
				<view style="color: #333333; font-size: 30rpx;">历史价格</view>
				<view style="color: #333333; font-size: 30rpx;">产品名称</view>
			</view>
		</view>
		<view class="box" v-for="(item,index) in sifts" :key='index'>
			<view class="box1">
				<view style="color: #ff4658; font-size: 50rpx;">{{item.content.currentProductCode}}</view>
				<view style="color: #333333; font-size: 18rpx;">{{item.content.currentProductName}}</view>
			</view>
			<view class="box2">
				<view style="color: #333333; font-size: 30rpx;">产品编号</view>
				<view style="color: #333333; font-size: 30rpx;">产品名称</view>
			</view>
		</view>
		<!--   <view class="top">
      <view class="txt">
        <text>历史</text>
        <view>南方元宝</view>
        <view>广发基金</view>
      </view>
	  <image src="../../static/iamges/yinhangkatianjia/shanchu@2x.png" mode=""></image>
    </view>
    <text>热搜榜</text>
    <view class="mian">
      <view>
        <text>1</text>
        <view>广发价值领先</view>
      </view>
      <view>
        <text>2</text>
        <view>广发价值领先</view>
      </view>
    </view>
       <view class="mian">
      <view>
        <text>1</text>
        <view>广发价值领先</view>
      </view>
      <view>
        <text>2</text>
        <view>广发价值领先</view>
      </view>
    </view> -->
	</view>
</template>

<script>
	import {
		createNamespacedHelpers
	} from 'vuex'
	const {
		mapState,
		mapActions
	} = createNamespacedHelpers('licai')
	export default {
		data() {
			return {
				input: ''
			}
		},
		methods: {
			...mapActions(['getAllProducts']),
			sousuo() {
				this.getAllProducts({
					keyword: this.input
				})
				

			},
		},
		computed:{
			...mapState(['funds','golds','regular','sifts'])
		}
	};
</script>
<style lang="scss" scoped>
	.box {
		height: 200rpx;
		margin-top: 30rpx;
		border-radius: 20rpx;
		
		background: #FFFFFF;

		.box1,
		.box2 {
			height: 50%;
			
			display: flex;
			//padding-top: 20rpx;
			line-height: 100rpx;

			view {
				width: 50%;
				text-align: center;

			}

		}
	}

	.search {
		background-color: #fafafa;
		padding: 24rpx;

		.top {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.txt {
				display: flex;
				align-items: center;

				view {
					margin-left: 30rpx;
					background-color: #ffffff;
					border: 1px solid #ffffff;
					padding: 5rpx;
					border-radius: 16rpx;
				}
			}

			image {
				width: 30rpx;
				height: 30rpx;
			}
		}

		text {
			font-size: 40rpx;
			font-weight: 600;
		}

		.mian {
			display: flex;
			justify-content: space-between;
			padding: 40rpx 0;

			view {
				display: flex;
				align-items: center;

				text {
					color: red;
					font-size: 30rpx;
					font-weight: 400;
					padding-right: 20rpx;
				}
			}
		}
	}

	.shousuo {

		width: 100%;
		background-color: #FFFFFF;
		display: flex;
		justify-content: space-between;
		border-radius: 10rpx;
		padding: 0px 20rpx;

		image {
			width: 40rpx;
			height: 40rpx;
		}
	}
</style>
